//package com.controller;
//
//import org.springframework.stereotype.Controller;
//import org.springframework.ui.Model;
//import org.springframework.ui.ModelMap;
//import org.springframework.web.bind.annotation.RequestMapping;
//import org.springframework.web.servlet.ModelAndView;
//
//import javax.servlet.ServletContext;
//import javax.servlet.http.HttpServletRequest;
//import javax.servlet.http.HttpSession;
//import java.util.Map;
//
///**
// * @author WZ
// * @version 1.0
// * @date 2021/8/18 14:41
// */
//@Controller
//public class ScopeController {
//
//    @RequestMapping("/testRequestByServletAPI")
//    public String testRequestByServletAPI(HttpServletRequest request){
//
//        request.setAttribute("testRequestScope","hello ,servletAPI");
//        return "success";
//    }
//
//    @RequestMapping("/testModelAndView")
//    public ModelAndView testModelAndView(){
//        ModelAndView mav=new ModelAndView();
//        //处理模型数据，即向请求域request共享数据
//        mav.addObject("testRequestScope","hello,ModelAndView");
//        //设置使徒名称
//        mav.setViewName("success");
//        return  mav;
//}
//@RequestMapping("/testModel")
//    public String testModel(Model model){
//        model.addAttribute("testRequestScope","hello,model");
//        return "success";
//}
//@RequestMapping("/testMap")
//    public String testMap(Map<String,Object> map){
//        map.put("testRequestScope","hello ,map");
//
//        return  "success";
//}
//@RequestMapping("/testModelMap")
//    public  String testModelMap(ModelMap modelMap){
//        modelMap.addAttribute("testRequestScope","hello modelmap");
//        return "success";
//
//}
//@RequestMapping("/testSession")
//    public  String testSesstion(HttpSession session){
//        session.setAttribute("testSessionScope","hello,session");
//        return "success";
//
//}
//@RequestMapping("/testApplication")
//    public String tetsApplication(HttpSession session){
//    ServletContext application=session.getServletContext();
//    application.setAttribute("testApplicationScope","hello,application");
//    return "success";
//}
//}
